package orgamenu.ihm.table;

import java.awt.Color;
import java.awt.Component;
import java.awt.Font;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

public class MenuTableRenderer extends DefaultTableCellRenderer {
	

	private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int col) {

		super.getTableCellRendererComponent(table, value, isSelected, hasFocus,
				row, col);
		// Modification de la police
		Font f = getFont();
		f = f.deriveFont((float) 20);
		f = f.deriveFont(Font.BOLD);
		setFont(f);
		// Couleurs
		if (isSelected) {
			setBackground(Color.red);
			setForeground(Color.white);
		} else {
			setBackground(Color.white);
			setForeground(Color.blue);
		}

		return this;
	}
	
	
	
}